import type { App, Plugin } from 'vue'
import impExcel from './src/ImportExcel.vue'

const withInstall = <T>(component: T, alias?: string) => {
  const comp = component as any
  comp.install = (app: App) => {
    app.component(comp.name || comp.displayName, component)
    if (alias) {
      app.config.globalProperties[alias] = component
    }
  }
  return component as T & Plugin
}
export const ImpExcel = withInstall(impExcel)
export * from './src/typing'
export { jsonToSheetXlsx, aoaToSheetXlsx } from './src/Export2Excel'
